1. Field of the Invention
The present invention relates to an apparatus for and method of counting a number of revolutions of a servo motor for detecting an amount of movement of a rotary arm of an articulation robot by counting a nynber of revolutions of a servo motor which drives the articulation robot and the like, and more particularly to an apparatus and method wherein a square pulse from an encoder attached to the servo motor can be divided by a pulse suitable for an operating frequency range of a position controller which controls said servo motor.
2. Description of the Prior Art
In a conventional counting circuit such as that illustrated in FIG. 1, a pulse input channel a is jointly connected to an first input terminal of an exclusive OR gate G11 and to an input terminal D1 of a flip flop FF11. A second input terminal of said exclusive OR gate G11 is connected to a pule input channel B. Square pulses denoting revolutions information concerning a servo motor are outputted from an encoder (not shown) to the pulse input channels A and B.
The pulse input channel B is also connected to a first input terminal of an exclusive OR gate G12 and simultaneously is connected to a second input terminal of the exclusive OR gate G12 through a resistor R1 and a capacitor C1. An output terminal of the exclusive OR gate G12 is connected to a clock input CK1 of said flip flop FF11.
An output terminal of the exclusive OR gate G11 is connected to a first input terminal of an exclusive OR gate G13. The output terminal is also connected to a second input terminal of said exclusive OR gate G12 through a resistor R2 and a capacitor C2. An output terminal of the exclusive OR gate G13 is connected through a resistor R3 and a capacitor C3 to a first input terminal of NAND gates NG1, NG2 wherefrom and output terminals are connected respectively to either an up-terminal or a down-terminal or a counter 21. A second input terminal of the NAND gate NG1 is connected to the output terminal of the exclusive OR gate G14. A first input terminal of the exclusive OR gate G14 is connected to an output terminal Q1 of said flip flop FF11 and a second input terminal of the exclusive OR gate G14 is connected to said pulse input channel B. The output terminal of exclusive OR gate G14 is connected to a second input terminal of said NAND gate NG2 through an inverter 11.
In the conventional counting circuit as described in the foregoing, square pulses depicted in FIG. 2A are supplied to the first input terminal of the exclusive OR gate G11 through the pulse input channel A depicted in FIG. 1 in accordance with forward or reverse rotations of a rotary shaft. The square pulses illustrated in FIG. 2B are supplied to the second input terminals of the exclusive OR gates G11 and G12 through the pulse input channel B and simultaneously are supplied to the second input terminal of said exclusive OR gate G12 after a predetermined period of delay time when transferred through the resistor R1 and the capacitor C1.
Accordingly, the square pulses illustrated in FIG. 2C are supplied from the output side of exclusive OR gate G11 to a first input terminal of exclusive OR gate G13 and simultaneously are supplied to a second input terminal of the exclusive OR gate G13 after a predetermined period of delay time when transferred through the resistor R2 and the capacitor C2. The square pulses as depicted in FIG. 2D are outputted from an output terminal of the exclusive OR gate G13 and the outputted square pulses are supplied to the first input terminal of NAND gates NG1 and NG2 through the resistor R3 and the capacitor C3 after a predetermined period of delay time.
The square pulses as illustrated in FIG. 2E outputted from an output terminal of the exclusive OR gate G12 are supplied to the clock input CK1 of the flip flop FF11. The pulses illustrate in FIG. 2F are outputted to an output terminal Q1 of the flip flop FF11, and are supplied to a first input terminal of the exclusive OR gate G14. The square pulses illustrated in FIG. 2B inputted to the pulse input channel B are supplied to a second input terminal of the exclusive OR gate G14.
Accordingly, a high level signal or a low level signal is outputted from an output terminal of the exclusive OR gate G14 in accordance with the rotation of the rotary shaft in the forward or reverse directions as illustrated in FIG. 2G. The resulting signal is supplied to the second input terminal of NAND gate NG1, and at the same time, is inverted to a low level signal or a high level signal through an inverter 11 as illustrated in FIG. 2H and supplied to the second input terminal of NAND gate NG2.
Consequently, square pulses as illustrated in FIG. 2I and FIG. 2J are outputted from the output terminals of NAND gates NG1 and NG2 and are supplied to Up and Down terminals of a counter 21. The counter 21 increases of decreases its pulse count by one in accordance with one revolution of the rotary shaft thereby counting that revolution of the rotary shaft.
In this kind of conventional counting circuit, as the rotary shaft performs one revolution, pulses being inputted into the pulse input channels A and B are multiplied four times, and the counter down-counts or up-counts the multiplied pulses to count the revolution of the rotary shaft. However, because a position controller (not shown) which controls a servo motor differs in rated frequency ranges according to the type employed, the conventional counting circuit, which counts the pulses outputted in accordance with one revolution of the rotary shaft only within an output frequency range corresponding to its predetermined range, can only use a position controller which operates within an output frequency range corresponding to its predetermined range. If the rated frequency range of the position controller is less than the output frequency of the counting circuit, a problem arises in that said conventional counting circuit can not be used.